package com.optimize.controller;

import java.util.List;

import javax.inject.Inject;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.optimize.entity.Power;
import com.optimize.service.PowerService;


@Controller
@RequestMapping("/engrgyoptimi")
public class PowerController{
	
	@Inject
	private PowerService powerService; 
	
	/**
	 * 参数优化页面
	 * @return
	 */
	@RequestMapping("/optimization")
	public String optimization(Model model){
		model.addAttribute("currentName","工艺参数优化");
		return "optimize/optimization";
	}
	
	@RequestMapping("/power")
	public  @ResponseBody List<Power> power(){
		return powerService.findAllPower();
	}
	
	/**
	 * 工艺能耗页面
	 * @return
	 */
	@RequestMapping("/crafts")
	public String crafts(Model model){
		model.addAttribute("currentName","能耗定额");
		return "optimize/crafts";
	}
	
	/**
	 * 历史数据页面
	 * @return
	 */
	@RequestMapping("/history")
	public String history(Model model){
		model.addAttribute("currentName","错峰排程");
		return "optimize/history";
	}
}

